package com.netease.o;

import android.net.Uri;
import com.netease.b.a.ab;
import com.netease.b.a.j;
import com.netease.framework.a.m;
import com.netease.o.a.c;
import com.netease.pris.atom.ad;
import java.io.File;
import java.util.LinkedList;
import java.util.Vector;
import org.json.JSONArray;
import org.json.JSONObject;

public class b extends j
{
  public static final int d = 1;
  public static final int e = 2;
  public static final int f = 3;
  public static final int g = 4;
  private static final String i = "NewsTransaction";
  String a;
  int b;
  int c;

  protected b(int paramInt, String paramString)
  {
    super(paramInt);
    this.a = paramString;
  }

  public static b a()
  {
    return new b(7, null);
  }

  public static b a(String paramString)
  {
    return new b(10, paramString);
  }

  public static b a(String paramString, int paramInt1, int paramInt2)
  {
    b localb = new b(8, paramString);
    localb.e(paramInt1);
    localb.f(paramInt2);
    return localb;
  }

  private void a(JSONObject paramJSONObject)
  {
    JSONArray localJSONArray = paramJSONObject.optJSONArray("default-topicset");
    if (localJSONArray != null)
    {
      LinkedList localLinkedList = new LinkedList();
      for (int j = 0; j < localJSONArray.length(); j++)
        localLinkedList.add(new com.netease.o.a.d(localJSONArray.optJSONObject(j)).c());
      c(0, new com.netease.pris.protocol.d(localLinkedList));
    }
  }

  public static b b(String paramString)
  {
    return new b(11, paramString);
  }

  public static b b(String paramString, int paramInt1, int paramInt2)
  {
    b localb = new b(9, paramString);
    localb.e(paramInt1);
    localb.f(paramInt2);
    return localb;
  }

  private void b(JSONObject paramJSONObject)
  {
    JSONArray localJSONArray = paramJSONObject.optJSONArray(this.a);
    if (localJSONArray != null)
    {
      LinkedList localLinkedList = new LinkedList();
      for (int j = 0; j < localJSONArray.length(); j++)
        localLinkedList.add(new com.netease.o.a.a(localJSONArray.optJSONObject(j)).k());
      com.netease.pris.protocol.d locald = new com.netease.pris.protocol.d(localLinkedList);
      locald.g = new ad();
      com.netease.f.b localb = locald.g.f("link");
      localb.b("rel", "next");
      localb.b("href", String.valueOf(this.b + this.c));
      c(0, locald);
    }
  }

  private void c(JSONObject paramJSONObject)
  {
    JSONObject localJSONObject = paramJSONObject.optJSONObject(this.a);
    if (localJSONObject != null)
    {
      LinkedList localLinkedList = new LinkedList();
      localLinkedList.add(new c(localJSONObject).j());
      c(1, new com.netease.pris.protocol.d(localLinkedList));
      c(4, null);
    }
  }

  private void e(int paramInt)
  {
    this.b = paramInt;
  }

  private void f(int paramInt)
  {
    this.c = paramInt;
  }

  public com.netease.framework.b.b a(Object paramObject, int paramInt1, int paramInt2)
  {
    return new a(this, paramObject, paramInt1, paramInt2);
  }

  public com.netease.framework.b.b a(Vector paramVector, Object paramObject, int paramInt1, int paramInt2)
  {
    return new a(paramVector, paramObject, paramInt1, paramInt2);
  }

  protected void a(int paramInt, Object paramObject)
  {
    JSONObject localJSONObject;
    if ((paramObject != null) || ((paramObject instanceof JSONObject)))
    {
      localJSONObject = (JSONObject)paramObject;
      switch (n())
      {
      default:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      }
    }
    while (true)
    {
      return;
      a(localJSONObject);
      continue;
      b(localJSONObject);
      continue;
      c(localJSONObject);
      continue;
      super.a(paramInt, paramObject);
    }
  }

  protected void b(int paramInt, Object paramObject)
  {
    super.b(paramInt, null);
  }

  public void c()
  {
    com.netease.g.b.d("NewsTransaction", "NewsTransaction onTransact start " + System.currentTimeMillis());
    m localm;
    switch (n())
    {
    default:
      localm = null;
      if (localm != null)
        break;
      d(0, null);
      h();
    case 7:
    case 8:
    case 9:
    case 10:
    case 11:
    }
    while (true)
    {
      com.netease.g.b.d("NewsTransaction", "NewsTransaction onTransact end " + System.currentTimeMillis());
      return;
      localm = new m("http://c.3g.163.com/nc/topicset/default.html");
      break;
      Object[] arrayOfObject3 = new Object[3];
      arrayOfObject3[0] = this.a;
      arrayOfObject3[1] = Integer.valueOf(this.b);
      arrayOfObject3[2] = Integer.valueOf(this.c);
      localm = new m(String.format("http://c.3g.163.com/nc/article/headline/%1$s/%2$d-%3$d.html", arrayOfObject3));
      break;
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = this.a;
      localm = new m(String.format("http://c.3g.163.com/nc/article/%1$s/head.html", arrayOfObject2));
      localm.e(true);
      localm.f(true);
      break;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = this.a;
      localm = new m(String.format("http://c.3g.163.com/nc/article/%1$s/tail.html", arrayOfObject1));
      break;
      localm.b("Accept-Encoding", "gzip,deflate");
      localm.b("User-Agent", "NETS Android");
      localm.b("Connection", "close");
      localm.d(true);
      localm.g(true);
      a(localm);
    }
  }

  public void c(int paramInt1, int paramInt2, int paramInt3, Object paramObject)
  {
    if ((paramInt2 == 1000) && (paramObject != null) && ((paramObject instanceof com.netease.b.a.b)))
    {
      com.netease.b.a.b localb = (com.netease.b.a.b)paramObject;
      if (localb.b != null)
        c(3, new ab(Uri.fromFile(new File(localb.b)).toString(), localb.a.hashCode()));
    }
    if (f())
      c(4, null);
  }

  public void d(int paramInt1, int paramInt2, int paramInt3, Object paramObject)
  {
    if (f())
      c(4, null);
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.o.b
 * JD-Core Version:    0.6.0
 */